package com.hadwinling.alogriithm.day04.myfor

object ForVar {
  def main(args: Array[String]): Unit = {
    for(i <- 1 to 3; j = 4 - i) {
      print(j + " ")  // 3,2,1
    }

    /*上面的代码等价
    for ( i <- 1 to 3) {
      val j = 4 –i
      print(j+"")
    }*/
  }
}
